import java.util.Scanner;

/**
 * @author： pang-yun
 * @date： 2022-02-12 10:18
 * Description:
 */

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int num = scanner.nextInt();

        for (int i = 1; i <= num; i++) {
            int origin = (i - 1) * i / 2 + 1;
            System.out.print(origin + " ");

            int step = i+1;
            for (int j = 1; j <= num - i; j++) {
                System.out.print(step + origin + " ");
                origin+=step;
                step++;
            }
            System.out.println();
        }
    }
}
